package com.twm.tamauth.utils

import android.app.AppOpsManager
import android.app.AppOpsManager.OPSTR_GET_USAGE_STATS
import android.app.usage.UsageStatsManager
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
import android.util.Log
import android.widget.Toast
import com.twm.tamauth.api.MyAuthOpenApi
import android.provider.Settings

class MyPackageManager(
    private val context: Context,
    private val userToken: String
) {

    // 初始化块，在构造函数调用时执行
    init {
        doInitialization()
    }

    private val pm: PackageManager = context.packageManager

    data class AppInfo(val packageName: String, val appName: String)

    private fun doInitialization() {
        // 在这里执行你的初始化逻辑
        // 可以使用构造函数中的参数和类的属性
        MyAuthOpenApi.updateUserToken(userToken)
    }

    /**
     * Check block
     */
    interface AppCheckCallback {
        fun onAppDetected(appInfo: String)
        fun onNoUndesiredAppFound()
    }

    /**
     * BackGroundCheckCallback block
     */
    interface BackGroundCheckCallback {
        fun onAppBackGroundDetected(aboveOtherApp: Boolean)
    }

    /**
     * Checks whether any undesired applications are installed.
     */
    fun checkForUndesiredApps(callback: AppCheckCallback) {
        val installedApplications = pm.getInstalledApplications(PackageManager.GET_META_DATA)
        var undesiredAppFound = false

        for (applicationInfo in installedApplications) {
            val matchedApp = appsToCheck.find { it.packageName == applicationInfo.packageName }
            if (matchedApp != null) {
                undesiredAppFound = true
                callback.onAppDetected(matchedApp.appName)
                break
            }
        }

        if (!undesiredAppFound) {
            callback.onNoUndesiredAppFound()
        }
    }

    /**
     * Displays a warning for detected undesired apps.
     */
    private fun showAlert(appInfo: AppInfo) {
        Toast.makeText(context, "⚠️ Warning! ${appInfo.appName} is flagged as undesirable.", Toast.LENGTH_LONG).show()
        Log.d("AppChecker", "${appInfo.appName} is installed.")
    }

    /**
     * List of undesired apps with their package names and display names.
     */
    private val appsToCheck = listOf(
        AppInfo(packageName = "com.pzds.pzds,5a8262e0d2ca6cdaf59ae787af719d33", appName = "盼之代售"),
        AppInfo(packageName = "com.tencent.tim,775e696d09856872fdd8ab4f3f06b1e0", appName = "TIM"),
        AppInfo(packageName = "dkplugin.fpz.hbu,e89b158e4bcf988ebd09eb83f5378e87", appName = "爸手机"),
        AppInfo(packageName = "dkplugin.wlm.mob,e89b158e4bcf988ebd09eb83f5378e87", appName = "妈15049525581"),
        AppInfo(packageName = "com.hihonor.rcsserviceapplication,2d314d835afc76af61719cfb7f78b51e", appName = "荣耀 RCS 服务"),
        AppInfo(packageName = "com.bqzj.im,9cc29d0f131703a72c4b794823d78ccd", appName = "白情中介"),
        AppInfo(packageName = "com.tencent.wework,011a40266c8c75d181ddd8e4ddc50075", appName = "企业微信"),
        AppInfo(packageName = "com.example.sgame,46e9e5f1dfbd091497579ef0387e5e70", appName = "密马小工具"),
        AppInfo(packageName = "com.jzzs.parentshelper,bd84c74da0006b0b6282ba9fdf612710", appName = "安全教育平台"),
        AppInfo(packageName = "bin.mt.plus,1a32f661095560285c0f7ea0b521cb45", appName = "MT管理器"),
        AppInfo(packageName = "com.vphonegaga.titan,6b491c8a171e6b46202d98adcd7a978f", appName = "光速虚拟机"),
        AppInfo(packageName = "eu.faircode.netguard,2731710b7b726b51ab58e8ccbcfeb586", appName = "NetGuard"),
        AppInfo(packageName = "com.android.settings,8ddb342f2da5408402d7568af21e29f9", appName = "Settings"),
        AppInfo(packageName = "com.android.printspooler,e89b158e4bcf988ebd09eb83f5378e87", appName = "Print Spooler"),
        AppInfo(packageName = "com.android.phone,8ddb342f2da5408402d7568af21e29f9", appName = "Phone Services"),
        AppInfo(packageName = "com.android.pacprocessor,8ddb342f2da5408402d7568af21e29f9", appName = "PacProcessor"),
        AppInfo(packageName = "com.svox.pico,e89b158e4bcf988ebd09eb83f5378e87", appName = "Pico TTS"),
        AppInfo(packageName = "com.android.systemui,8ddb342f2da5408402d7568af21e29f9", appName = "System UI"),
        AppInfo(packageName = "com.android.providers.contacts,5dc8201f7db1ba4b9c8fc44146c5bcc2", appName = "Contacts Storage"),
        AppInfo(packageName = "com.android.email,e89b158e4bcf988ebd09eb83f5378e87", appName = "Email"),
        AppInfo(packageName = "com.eg.android.alipaygphone,406d5150e64381124a7e8569f9784ed0", appName = "支付宝"),
        AppInfo(packageName = "com.xyn.wskai,e89b158e4bcf988ebd09eb83f5378e87", appName = "雪花❄️64位防三方框架"),
        AppInfo(packageName = "com.jinchanchan.guaishou,e89b158e4bcf988ebd09eb83f5378e87", appName = "怪兽防封插件"),
        AppInfo(packageName = "com.enennb.pubggl,e89b158e4bcf988ebd09eb83f5378e87", appName = "pubg国际服绘制"),
        AppInfo(packageName = "com.shouquan.tshouquan,e89b158e4bcf988ebd09eb83f5378e87", appName = "t授权64"),
        AppInfo(packageName = "ku.hh,db1e2717526c9b047cf3d8fdce566c1d", appName = "酷游网络_cfm防封(适配超级生化)"),
        AppInfo(packageName = "vip.fengyin.co,e89b158e4bcf988ebd09eb83f5378e87", appName = "风吟和平公益端口 3.2"),
        AppInfo(packageName = "com.vmos.pro,e89b158e4bcf988ebd09eb83f5378e87", appName = "快球"),
        AppInfo(packageName = "cn.v8box.app,e89b158e4bcf988ebd09eb83f5378e87", appName = "快球直装"),
        AppInfo(packageName = "com.sm,e89b158e4bcf988ebd09eb83f5378e87", appName = "快球内部"),
        AppInfo(packageName = "com.vphonegaga.titan,9f2b27e2a5dc591f6e7180c923e2c4d3", appName = "快球直装"),
        AppInfo(packageName = "com.tencent.gamereva,e89b158e4bcf988ebd09eb83f5378e87", appName = "脚本辅助"),
        AppInfo(packageName = "com.virb3.trustmealready,bdc3b7a09d2c7416349aa61c1796d520", appName = "惊世端口(xp作用域勾选和平精英)"),
        AppInfo(packageName = "com.tencent.tmgp.pubgmhd.obbdownloaderser,e89b158e4bcf988ebd09eb83f5378e87", appName = "熊猫框架"),
        AppInfo(packageName = "com.tencent.news,e89b158e4bcf988ebd09eb83f5378e87", appName = "牛逼修改器"),
        AppInfo(packageName = "com.touchsprite.android,c34029c6245674472ef1b9fa164b10e4", appName = "触动精灵"),
        AppInfo(packageName = "i7k7.com,e89b158e4bcf988ebd09eb83f5378e87", appName = "刺客防封"),
        AppInfo(packageName = "com.bfire.da.nuj,68170b6b26e52338bc07ae665303cc36", appName = "独角兽直装"),
        AppInfo(packageName = "com.orca.xarg,e89b158e4bcf988ebd09eb83f5378e87", appName = "群星2.3多功能绘制"),
        AppInfo(packageName = "jiyi.pubgmhd,64843786c6ada15ca4254f4da77e4978", appName = "寂懿公益端口"),
        AppInfo(packageName = "com.wzrys29.com,242b480a3ebd443977bf4ea528be8329", appName = "王者s29赛季绘制"),
        AppInfo(packageName = "com.nadigapp.desiespimportant,e89b158e4bcf988ebd09eb83f5378e87", appName = "繁华国际服单绘制"),
        AppInfo(packageName = "com.limo.shark,e89b158e4bcf988ebd09eb83f5378e87", appName = "独角鲸_绘制"),
        AppInfo(packageName = "com.tencent.wk,e89b158e4bcf988ebd09eb83f5378e87", appName = "悟空容器直装"),
        AppInfo(packageName = "com.tencent.iglitece,82edc90a7a5ad88139744dc8e5b14ddb", appName = "白开水轻体2.0直装"),
        AppInfo(packageName = "com.tencent.igce,82edc90a7a5ad88139744dc8e5b14ddb", appName = "白开水3.2国体直装"),
        AppInfo(packageName = "app.greyshirts.firewall,e89b158e4bcf988ebd09eb83f5378e87", appName = "定制鸭子免费防禁网端口"),
        AppInfo(packageName = "com.oooi.ooop,e89b158e4bcf988ebd09eb83f5378e87", appName = "战神直装v13"),
        AppInfo(packageName = "com.oktabagames.puzzle,6e372697756c9ece42103273e743feb3", appName = "鸡腿"),
        AppInfo(packageName = "by.ya.hui,c09b86aa545c8ec4821739aba2af2f81", appName = "北b直装4.0"),
        AppInfo(packageName = "com.zjdjdhdb.sbsh,e89b158e4bcf988ebd09eb83f5378e87", appName = "凌轩球球容器直装"),
        AppInfo(packageName = "com.yl,e89b158e4bcf988ebd09eb83f5378e87", appName = "幽灵直装(王者荣耀)"),
        AppInfo(packageName = "com.tencent.mobileqqsa,e89b158e4bcf988ebd09eb83f5378e87", appName = "八爪鱼"),
        AppInfo(packageName = "com.tencent.tmgp.speedmobile,e89b158e4bcf988ebd09eb83f5378e87", appName = "xy极速"),
        AppInfo(packageName = "cn.iyya.vvv,e89b158e4bcf988ebd09eb83f5378e87", appName = "小黄鸭过检测"),
        AppInfo(packageName = "com.mohe.cc,38a3d37904223849a1bbf867b0f1b83b", appName = "和平精英改文件"),
        AppInfo(packageName = "com.bairimeng.dmmdzz.m4399.bh.gg,c414784715dbd7c80d12805d4800a1c1", appName = "白鹤逃跑辅助"),
        AppInfo(packageName = "com.bh.tpfz.bh,c414784715dbd7c80d12805d4800a1c1", appName = "白鹤逃跑辅助内部专属版"),
        AppInfo(packageName = "com.nongnong.huimie,b9127548401a4151099ded74c0ccb5b6", appName = "毁灭mxs1.0"),
        AppInfo(packageName = "yuluo.kit,e89b158e4bcf988ebd09eb83f5378e87", appName = "雨落验证"),
        AppInfo(packageName = "com.snb,e89b158e4bcf988ebd09eb83f5378e87", appName = "神内部"),
        AppInfo(packageName = "com.windforce.wjxt.mi,e89b158e4bcf988ebd09eb83f5378e87", appName = "追踪版本"),
        AppInfo(packageName = "xiaojie.com,e89b158e4bcf988ebd09eb83f5378e87", appName = "小杰(修复bug)"),
        AppInfo(packageName = "com.wear.lovo,e89b158e4bcf988ebd09eb83f5378e87", appName = "星河qaq"),
        AppInfo(packageName = "com.yhy.view,e89b158e4bcf988ebd09eb83f5378e87", appName = "孤勇者"),
        AppInfo(packageName = "com.tencent.bgbg.king.yyds,e89b158e4bcf988ebd09eb83f5378e87", appName = "八嘎第六代"),
        AppInfo(packageName = "com.tencent.huo,e89b158e4bcf988ebd09eb83f5378e87", appName = "火柴"),
        AppInfo(packageName = "com.tencent.xning,e89b158e4bcf988ebd09eb83f5378e87", appName = "小柠檬"),
        AppInfo(packageName = "vip.glb.pubg,e89b158e4bcf988ebd09eb83f5378e87", appName = "lb端口1.2"),
        AppInfo(packageName = "hei.mao.zi,e89b158e4bcf988ebd09eb83f5378e87", appName = "黑帽子"),
        AppInfo(packageName = "vip.jsnbdk.co,e89b158e4bcf988ebd09eb83f5378e87", appName = "白将"),
        AppInfo(packageName = "com.taobao.trip,7c0b1050e1542dd5a4fae52c0d1df76a", appName = "飞猪旅行"),
        AppInfo(packageName = "ctrip.android.view,c3b0588dfc19315827a4c19d1c97622c", appName = "携程旅行"),
        AppInfo(packageName = "com.tencent.heisha,cb22d134b18cd7a6f735b597599ab60d", appName = "黑鲨"),
        AppInfo(packageName = "upp.com,e0971d70365c040dde2106f3012099a4", appName = "可可授权"),
        AppInfo(packageName = "com.shouquan.nmeng,e6c0bb5a762146a31e0c413c1db09d3a", appName = "石榴授权"),
        AppInfo(packageName = "ztbbvxar.scml,7375cb84004b0ec1dd55d179da54ee4a", appName = "hltpsgue"),
        AppInfo(packageName = "mos1n.yyds,e89b158e4bcf988ebd09eb83f5378e87", appName = "黑猫电竞"),
        AppInfo(packageName = "com.tencent.mengniu,e89b158e4bcf988ebd09eb83f5378e87", appName = "蒙牛"),
        AppInfo(packageName = "maomi.yanzheng,e89b158e4bcf988ebd09eb83f5378e87", appName = "陌生人验证"),
        AppInfo(packageName = "com.tencent.tmgp.sgame,e9b518b0fa85c7b7d5c2c5bfba79217d", appName = "王者荣耀"),
        AppInfo(packageName = "com.qiyi.video,846b46b26f2d9572124e4cfd778e8774", appName = "爱奇艺"),
        AppInfo(packageName = "com.hicorenational.antifraud,1034c7fd488bb6eff47d8b77c32eb256", appName = "国家反诈中心"),
        AppInfo(packageName = "com.baidu.searchbox,c2b0b497d0389e6de1505e7fd8f4d539", appName = "百度"),
        AppInfo(packageName = "com.tencent.mtt,d8391a394d4a179e6fe7bdb8a301258b", appName = "QQ浏览器"),
        AppInfo(packageName = "com.tencent.android.qqdownloader,a095641b30785f28642708f481603e0b", appName = "应用宝"),
        AppInfo(packageName = "com.mihoyo.yuanshen,5583e6a15a9cfbe6af9c945c5b8b1a4b", appName = "原神"),
        AppInfo(packageName = "com.tencent.tmgp.cf,aeabc9e282f62432d2be8e728da6210c", appName = "穿越火线:枪战王者"),
        AppInfo(packageName = "com.tencent.tmgp.cod,917ea68e4c94824e7be12c5dec8b1f0d", appName = "使命召唤手游"),
        AppInfo(packageName = "com.tencent.tmgp.bh3,6203756aea8a1b7d35bb0222a2444ec3", appName = "崩坏3"),
        AppInfo(packageName = "com.tencent.tmgp.pubgmhd,30b9081a748f61bf38d0ee87eb6451e1", appName = "和平精英"),
        AppInfo(packageName = "com.tencent.news,c414784715dbd7c80d12805d4800a1c1", appName = "ℳ̶̶̶̶໌꧔ꦿ"),
        AppInfo(packageName = "dkplugin.bgh.hwl,e89b158e4bcf988ebd09eb83f5378e87", appName = "密马游戏交易分身"),
        AppInfo(packageName = "com.limitemp.interstellar,e89b158e4bcf988ebd09eb83f5378e87", appName = "和平暖暖防封(加强版)"),
        AppInfo(packageName = "com.baidu.baidumap,c2b0b497d0389e6de1505e7fd8f4d539", appName = "百度地图"),
        AppInfo(packageName = "com.feiyu.carrot3.huawei,4c29e20d1ff98a2b9eeaebc35b6d7e16", appName = "保卫萝卜3"),
        AppInfo(packageName = "com.dianyun.pcgo,1fbc47b22254c7120cc48c607b3a1b08", appName = "菜鸡"),
        AppInfo(packageName = "com.tencent.lolm,a8df121f79960593b23a558e2154ffba", appName = "英雄联盟手游"),
        AppInfo(packageName = "com.example.encode,46e9e5f1dfbd091497579ef0387e5e70", appName = "轮询加密"),
        AppInfo(packageName = "com.tencent.tmgp.sgame,bf78d91858d82bda22dd067066b10964", appName = "王者荣耀"),
        AppInfo(packageName = "com.game.demo,b1b240162164c7cf155af3bfde7a6e80", appName = "華子"),
        AppInfo(packageName = "com.mycomvip,e89b158e4bcf988ebd09eb83f5378e87", appName = "框架防闪"),
        AppInfo(packageName = "com.jianshu.haruki,e89b158e4bcf988ebd09eb83f5378e87", appName = "无双"),
        AppInfo(packageName = "com.shqll,e89b158e4bcf988ebd09eb83f5378e87", appName = "内部z上号器"),
        AppInfo(packageName = "com.wz.log,e89b158e4bcf988ebd09eb83f5378e87", appName = "王者上号器"),
        AppInfo(packageName = "com.tencent.qqlogin,b1b240162164c7cf155af3bfde7a6e80", appName = "QQ上号器"),
        AppInfo(packageName = "com.qq.qcloud,f5d1d563d51eb54601192a29bdc4a825", appName = "腾讯微云"),
        AppInfo(packageName = "com.tencent.wemeet.app,ef1b5a11844923bb7515e6f6afcbc45f", appName = "腾讯会议"),
        AppInfo(packageName = "com.tencent.qgame,d6b29ec6c7dbe184beca96e772c0cc96", appName = "企鹅电竞"),
        AppInfo(packageName = "com.tencent.gamereva,3612b8bd0ef6bafdc2a4636ef7882ed9", appName = "腾讯先游"),
        AppInfo(packageName = "com.tencent.now,cd327297caed708483ccb89be5214180", appName = "腾讯NOW直播"),
        AppInfo(packageName = "com.tencent.docs,90b7821d0a177b33d94f4b98161550af", appName = "腾讯文档"),
        AppInfo(packageName = "com.tencent.qqsports,4765e7f09227a0770e966eed9a75c2cd", appName = "腾讯体育"),
        AppInfo(packageName = "com.tencent.weishi,2a281593d71df33374e6124e9106df08", appName = "微视"),
        AppInfo(packageName = "com.tencent.tgclub,d97919d8c23c119b23c51330cae2b8f1", appName = "心悦俱乐部"),
        AppInfo(packageName = "com.tencent.xriver,44a187f2ee2e12c5f3e7ad365011425e", appName = "腾讯加速器极速版"),
        AppInfo(packageName = "com.tencent.djcity,7849fa0ebdaaee647613617a27c0b50e", appName = "掌上道聚城"),
        AppInfo(packageName = "com.tencent.wifimanager,00b1208638de0fcd3e920886d658daf6", appName = "腾讯WiFi管家"),
        AppInfo(packageName = "com.tencent.gamecommunity,d0738eb3f483cc0a3be41dcecadd26e5", appName = "腾讯游戏社区"),
        AppInfo(packageName = "com.tencent.token,cb746ce354d17d9bcd03f7f8c232f4c1", appName = "QQ安全中心"),
        AppInfo(packageName = "com.qb.qtranslator,71b3016322bb12ebbe6ab83174200496", appName = "腾讯翻译君"),
        AppInfo(packageName = "com.tencent.csapp,ea6dfd251e2d91c9a19358188ff964d0", appName = "腾讯搜活帮"),
        AppInfo(packageName = "com.tencent.qqgame.qqhlupwvga,f6a0bb7245074b9f080d03796f8919db", appName = "欢乐升级"),
        AppInfo(packageName = "com.tencent.radio,6946e6dad511713b3c65f1bf1d016a1d", appName = "企鹅FM"),
        AppInfo(packageName = "com.qq.reader,a6b745bf24a2c277527716f6f36eb68d", appName = "QQ阅读"),
        AppInfo(packageName = "com.tencent.qqmusiclite,cbd27cd7c861227d013a25b2d10f0799", appName = "QQ音乐简洁版"),
        AppInfo(packageName = "com.tencent.qt.sns,4fbb147f3a7bea78fb36cb38a63e92fb", appName = "掌上穿越火线"),
        AppInfo(packageName = "com.tencent.rijvideo,9a08e8903851510d8b51c3a9fe17262a", appName = "看点"),
        AppInfo(packageName = "com.tencent.fortuneplat,f0fb1bb10c5cde9a84897d3d74a75ca9", appName = "腾讯理财通"),
        AppInfo(packageName = "com.tencent.xw,675bd6189723ce00e578cac1ea6c567d", appName = "腾讯小微"),
        AppInfo(packageName = "com.tencent.igame,62b89e41243abc76c980ab31d5b90517", appName = "王者人生"),
        AppInfo(packageName = "com.tencent.dwdcoco,97597eefa2836ddfd9eaa39fc65e3cee", appName = "小鹅拼拼"),
        AppInfo(packageName = "com.tencent.k12,12055ef8f07417f645bc06bac212a972", appName = "腾讯企鹅辅导"),
        AppInfo(packageName = "com.tencent.qidian,a01eecab85e9e3ba2b0f6a158c855c29", appName = "腾讯企点"),
        AppInfo(packageName = "com.tencent.edutea,9c222d3d906028eeea5aaefac8d31997", appName = "腾讯课堂老师版"),
        AppInfo(packageName = "com.tencent.aieducation,9645bf52ae06d1f1b70667635f54dcb1", appName = "腾讯英语君"),
        AppInfo(packageName = "com.tencent.eduplatform,59c5301b71fa5505aea1f8be79f32a15", appName = "腾讯作业君"),
        AppInfo(packageName = "com.tencent.qqlivekid,106409a8f91a970d58beb2263ce7550f", appName = "小企鹅乐园"),
        AppInfo(packageName = "com.tencent.map.care,13e26ff898d596712c2abe348d2cfb6b", appName = "腾讯地图关怀版"),
        AppInfo(packageName = "com.tencent.abcmouse,74f5cae303e03687bc90fd9695043e53", appName = "腾讯开心鼠"),
        AppInfo(packageName = "com.tencent.dingdang.speakermgr,36ed91edfe25b2286b2f194d24fea1f7", appName = "腾讯叮当"),
        AppInfo(packageName = "com.tencent.teamgallery,00b1208638de0fcd3e920886d658daf6", appName = "腾讯相册管家团队版"),
        AppInfo(packageName = "com.tencent.aiteachermiddleschool,0ad41f809dbd477fde4c82a60f3a4fc6", appName = "腾讯英语君(中学)"),
        AppInfo(packageName = "com.tencent.codingpri,dca8947e554b699cc65f555bcc42833c", appName = "腾讯扣叮-编程第一课"),
        AppInfo(packageName = "com.tencent.iot.explorer.link,5a25b4040cf95ebccf449bd8c6bcd984", appName = "腾讯连连"),
        AppInfo(packageName = "com.tencent.liveassistant,d6b29ec6c7dbe184beca96e772c0cc96", appName = "企鹅电竞直播助手"),
        AppInfo(packageName = "com.tencent.gamehelper.nz,f8cdcfe8b8e226916e466b454cc72d24", appName = "逆战助手"),
        AppInfo(packageName = "com.qcloud.cos.client,662d408b1d1a5c6b127d152a324627b6", appName = "COSBrowser"),
        AppInfo(packageName = "com.tencent.mp,b4f21425075f9d678495fc67cca39be5", appName = "订阅号助手"),
        AppInfo(packageName = "com.tencent.edu,c2a9e5bb90dd955d0d42430515b5e43f", appName = "腾讯课堂"),
        AppInfo(packageName = "com.tencent.portfolio,98a6788beeaeaa9446e0a7d146d222be", appName = "腾讯自选股"),
        AppInfo(packageName = "com.qq.ac.android,4efd7311e0cc3f3a8b1bfe5024a2104e", appName = "腾讯动漫"),
        AppInfo(packageName = "com.tencent.cmocmna,615ba2220d592982123f314f4f0acfbc", appName = "腾讯手游加速器"),
        AppInfo(packageName = "com.tencent.qqgame.xq,f6a0bb7245074b9f080d03796f8919db", appName = "天天象棋"),
        AppInfo(packageName = "com.tencent.gallerymanager,00b1208638de0fcd3e920886d658daf6", appName = "相册管家"),
        AppInfo(packageName = "com.tencent.litenow,85a2cdb233d6564471008739e32eef9e", appName = "看点直播(原腾讯直播)"),
        AppInfo(packageName = "com.tencent.gamehelper.dnf,f8cdcfe8b8e226916e466b454cc72d24", appName = "DNF助手"),
        AppInfo(packageName = "com.tencent.qt.qtl,4fbb147f3a7bea78fb36cb38a63e92fb", appName = "掌上英雄联盟"),
        AppInfo(packageName = "com.youdao.note,4c610fe814ccd3b3f41b30b90cde87f5", appName = "有道云笔记"),
        AppInfo(packageName = "com.browser2345,293c582082032d5b79591d35e8794f06", appName = "无备注"),
        AppInfo(packageName = "com.tencent.patrickstar", appName = "无备注"),
        AppInfo(packageName = "com.sahdg.dfsdf", appName = "无备注"),
        AppInfo(packageName = "com.linggame.app", appName = "无备注"),
        AppInfo(packageName = "游戏美化小助手", appName = "无备注"),
        AppInfo(packageName = "amcefk.top,e89b158e4bcf988ebd09eb83f5378e87", appName = "无备注"),
        AppInfo(packageName = "com.tencent.wksd,e89b158e4bcf988ebd09eb83f5378e87", appName = "无备注"),
        AppInfo(packageName = "大蛇", appName = "外挂"),
        AppInfo(packageName = "鸡腿", appName = "外挂"),
        AppInfo(packageName = "验证地址", appName = "外挂"),
        AppInfo(packageName = "zhantianxia.yyds", appName = "外挂"),
        AppInfo(packageName = "com.kqdqxe.wqfaolotsp", appName = "外挂"),
        AppInfo(packageName = "com.tencent.xh", appName = "外挂"),
        AppInfo(packageName = "com.tencent.xiaojif", appName = "外挂"),
        AppInfo(packageName = "稳定上分", appName = "外挂"),
        AppInfo(packageName = "防三方", appName = "外挂"),
        AppInfo(packageName = "com.tencent.tmrc", appName = "外挂"),
        AppInfo(packageName = "vip.yunyi.cn", appName = "外挂"),
        AppInfo(packageName = "com.xzq.fo0", appName = "外挂"),
        AppInfo(packageName = "com.tencent.mxfsf", appName = "外挂"),
        AppInfo(packageName = "com.tencent.mc", appName = "外挂"),
        AppInfo(packageName = "com.bmqh.nbb", appName = "外挂"),
        AppInfo(packageName = "dkplugin.fyk.vpr", appName = "外挂"),
        AppInfo(packageName = "fun.kitsunebi.kitsunebi4android,e89b158e4bcf988ebd09eb83f5378e87", appName = "无备注"),
        AppInfo(packageName = "风吟", appName = "无备注"),
        AppInfo(packageName = "o0ooot00o.nooroyt.ooionouq", appName = "外挂"),
        AppInfo(packageName = "com.google.king", appName = "外挂"),
        AppInfo(packageName = "com.tencent.aarrll", appName = "外挂"),
        AppInfo(packageName = "com.tyjnb", appName = "外挂"),
        AppInfo(packageName = "com.lemon.xyyydswswj", appName = "外挂"),
        AppInfo(packageName = "com.tencent.gt", appName = "外挂"),
        AppInfo(packageName = "com.coolapk.wha*", appName = "外挂"),
        AppInfo(packageName = "com.tenceng.fassha", appName = "外挂"),
        AppInfo(packageName = "com.tencent.maidanglao", appName = "外挂"),
        AppInfo(packageName = "com.tencent.snake", appName = "外挂"),
        AppInfo(packageName = "com.nb.lsp", appName = "外挂"),
        AppInfo(packageName = "密马游戏交易分身", appName = "密马分身"),
        AppInfo(packageName = "防封", appName = "无备注"),
        AppInfo(packageName = "dkplugin.mef.eyg", appName = "和平精英外挂"),
        AppInfo(packageName = "yzdz.apk", appName = "和平精英外挂"),
        AppInfo(packageName = "com.tencent.bear", appName = "无备注"),
        AppInfo(packageName = "cn.louisvuitton", appName = "无备注"),
        AppInfo(packageName = "com.tencent.xhy", appName = "无备注"),
        AppInfo(packageName = "com.unionpay.gmspacks", appName = "无备注"),
        AppInfo(packageName = "xiaojie.cc", appName = "无备注"),
        AppInfo(packageName = "com.coolapk.whale23", appName = "无备注"),
        AppInfo(packageName = "com.tencent.gamerevatutu", appName = "无备注"),
        AppInfo(packageName = "内部框架", appName = "无备注"),
        AppInfo(packageName = "穿墙", appName = "无备注"),
        AppInfo(packageName = "锁血", appName = "无备注"),
        AppInfo(packageName = "com.tencent.yibao", appName = "无备注"),
        AppInfo(packageName = "com.s.d", appName = "无备注"),
        AppInfo(packageName = "com.xixuan.xixkkkk", appName = "无备注"),
        AppInfo(packageName = "com.tencent.xxppll", appName = "无备注"),
        AppInfo(packageName = "com.tencent.iot.gui", appName = "无备注"),
        AppInfo(packageName = "com.guimie.android", appName = "无备注"),
        AppInfo(packageName = "armadillo.studio", appName = "无备注"),
        AppInfo(packageName = "内透", appName = "无备注"),
        AppInfo(packageName = "com.camerasideas.bai", appName = "无备注"),
        AppInfo(packageName = "追封", appName = "无备注"),
        AppInfo(packageName = "com.aaa", appName = "无备注"),
        AppInfo(packageName = "com.shsj.chinese", appName = "无备注"),
        AppInfo(packageName = "com.tencent.dream", appName = "无备注"),
        AppInfo(packageName = "女帝v", appName = "框架"),
        AppInfo(packageName = "com.tencent.tmgp.pubgmhd.ext.addon.arm32", appName = "框架"),
        AppInfo(packageName = "com.tencent.tmgp.pubgmhd.obbdownloaderses", appName = "框架"),
        AppInfo(packageName = "com.boxiantaopaokj", appName = "框架"),
        AppInfo(packageName = "com.bzty.rq", appName = "框架"),
        AppInfo(packageName = "com.tencent.mobileqq.qq", appName = "框架"),
        AppInfo(packageName = "com.tencent.mobileqq.tmgp.db", appName = "框架"),
        AppInfo(packageName = "com.zhongxiaye", appName = "无备注"),
        AppInfo(packageName = "com.coolapk.whale24", appName = "无备注"),
        AppInfo(packageName = "kk.lenb.nb", appName = "无备注"),
        AppInfo(packageName = "com.aq.c", appName = "无备注"),
        AppInfo(packageName = "com.teng.a", appName = "无备注"),
        AppInfo(packageName = "com.maotou.ying", appName = "无备注"),
        AppInfo(packageName = "com.gjzs.chongzhi.online", appName = "无备注"),
        AppInfo(packageName = "com.tencent.watermelon", appName = "西瓜"),
        AppInfo(packageName = "绘制", appName = "无备注"),
        AppInfo(packageName = "自瞄", appName = "无备注"),
        AppInfo(packageName = "单板", appName = "无备注"),
        AppInfo(packageName = "除草", appName = "无备注"),
        AppInfo(packageName = "com.tencent.androidqqmail1", appName = "无备注"),
        AppInfo(packageName = "com.ikooc.ccc", appName = "无备注"),
        AppInfo(packageName = "com.ikooc.zm", appName = "无备注"),
        AppInfo(packageName = "com.in.san", appName = "无备注"),
        AppInfo(packageName = "com.ikooc.luoli", appName = "无备注"),
        AppInfo(packageName = "com.yingyan.clone.clone", appName = "无备注"),
        AppInfo(packageName = "com.myfusapp.kq", appName = "无备注"),
        AppInfo(packageName = "com.dxbm", appName = "无备注"),
        AppInfo(packageName = "com.la.ky", appName = "无备注"),
        AppInfo(packageName = "com.tencent.ig.exa", appName = "无备注"),
        AppInfo(packageName = "com.excelliance.dualaid,e89b158e4bcf988ebd09eb83f5378e87", appName = "无备注"),
        AppInfo(packageName = "com.jdffyq", appName = "无备注"),
        AppInfo(packageName = "com.tencent.igolivic", appName = "无备注"),
        AppInfo(packageName = "com.tencent.fire", appName = "无备注"),
        AppInfo(packageName = "com.you.li.fang", appName = "无备注"),
        AppInfo(packageName = "com.mycompany.myapp1", appName = "无备注"),
        AppInfo(packageName = "www.lianbing.com", appName = "无备注"),
        AppInfo(packageName = "com.t4.pro", appName = "无备注"),
        AppInfo(packageName = "com.tencent.fuyao", appName = "无备注"),
        AppInfo(packageName = "com.synb.root", appName = "无备注"),
        AppInfo(packageName = "com.tencent.cai", appName = "尘埃"),
        AppInfo(packageName = "com.kgfse.alxneg*", appName = "alxneg21 未知外挂"),
        AppInfo(packageName = "com.android.z", appName = "zsuper"),
        AppInfo(packageName = "com.tencent.gamehelper.pg,f8cdcfe8b8e226916e466b454cc72d24", appName = "无备注"),
        AppInfo(packageName = "com.xiaoyi.yyds", appName = "王者荣耀练习生"),
        AppInfo(packageName = "com.koushikdutta.superuser", appName = "王者荣耀超级用户"),
        AppInfo(packageName = "com.ibreader.illustration", appName = "王者荣耀西施外挂"),
        AppInfo(packageName = "net.xkejsjesa.sjdjjsjt", appName = "泡泡龙"),
        AppInfo(packageName = "com.tencent.cece", appName = "无备注"),
        AppInfo(packageName = "com.nbcom.ying", appName = "无备注"),
        AppInfo(packageName = "com.tencent.cecom", appName = "无备注"),
        AppInfo(packageName = "com.coolapk.whale", appName = "无备注"),
        AppInfo(packageName = "net.bjwolf", appName = "无备注"),
        AppInfo(packageName = "com.coolapk.pepsi21", appName = "无备注"),
        AppInfo(packageName = "com.tencent.wk", appName = "无备注"),
        AppInfo(packageName = "com.xixuan.xig", appName = "无备注"),
        AppInfo(packageName = "com.dianfeng.android", appName = "无备注"),
        AppInfo(packageName = "com.miui.bjl", appName = "无备注"),
        AppInfo(packageName = "com.dlq", appName = "无备注"),
        AppInfo(packageName = "com.wukong.android", appName = "无备注"),
        AppInfo(packageName = "net.solo.df", appName = "无备注"),
        AppInfo(packageName = "com.coolapk.bilibli", appName = "无备注"),
        AppInfo(packageName = "com.axl", appName = "无备注"),
        AppInfo(packageName = "com.miui.pes", appName = "无备注"),
        AppInfo(packageName = "com.coolaapk.balloon", appName = "无备注"),
        AppInfo(packageName = "com.coolapk1.balloon", appName = "无备注"),
        AppInfo(packageName = "com.tencent.ac10", appName = "无备注"),
        AppInfo(packageName = "com.ltynt.mtp", appName = "无备注"),
        AppInfo(packageName = "com.tencent.tmgp.sgame.tube", appName = "无备注"),
        AppInfo(packageName = "com.tedjfjdjncent.tmgdjdjdp.sgadjdjdme.tubf", appName = "无备注"),
        AppInfo(packageName = "com.aiyou.android", appName = "无备注"),
        AppInfo(packageName = "com.tencent.newu", appName = "无备注"),
        AppInfo(packageName = "com.tencent.ass", appName = "无备注"),
        AppInfo(packageName = "com.shanghaoqi.ash", appName = "无备注"),
        AppInfo(packageName = "com.tencent.cbdx", appName = "无备注"),
        AppInfo(packageName = "com.tencent.cbd", appName = "无备注"),
        AppInfo(packageName = "com.douya.app", appName = "无备注"),
        AppInfo(packageName = "com.jy.jy", appName = "无备注"),
        AppInfo(packageName = "com.tencent.noz", appName = "无备注"),
        AppInfo(packageName = "com.tencent.weiruan", appName = "无备注"),
        AppInfo(packageName = "com.vvvvv.android", appName = "无备注"),
        AppInfo(packageName = "wechat.login.game.two", appName = "无备注"),
        AppInfo(packageName = "com.tencent.s.h.q", appName = "无备注"),
        AppInfo(packageName = "com.tencent.mobileqqj", appName = "无备注"),
        AppInfo(packageName = "com.vv", appName = "无备注"),
        AppInfo(packageName = "com.ayao.android", appName = "无备注"),
        AppInfo(packageName = "com.tencent.mobileqqks", appName = "无备注"),
        AppInfo(packageName = "com.tencent.ppkk", appName = "无备注"),
        AppInfo(packageName = "com.bubbles.dragon", appName = "无备注"),
        AppInfo(packageName = "com.muhou", appName = "无备注"),
        AppInfo(packageName = "com.jingyao.qianfu", appName = "无备注"),
        AppInfo(packageName = "com.yami.mnd", appName = "无备注"),
        AppInfo(packageName = "com.tencent.hn", appName = "无备注"),
        AppInfo(packageName = "top.ymlwse.lie", appName = "无备注"),
        AppInfo(packageName = "com.tencent.ttnb", appName = "无备注"),
        AppInfo(packageName = "com.tencent.ve", appName = "无备注"),
        AppInfo(packageName = "com.tencent.emilia", appName = "无备注"),
        AppInfo(packageName = "com.luyisi.cn", appName = "无备注"),
        AppInfo(packageName = "com.zhongpaolinjie.timi", appName = "无备注"),
        AppInfo(packageName = "believe.in.yourself", appName = "无备注"),
        AppInfo(packageName = "com.tencent.lmp", appName = "无备注"),
        AppInfo(packageName = "com.tencent.tmgp.egm", appName = "无备注"),
        AppInfo(packageName = "com.tencent.tmgp.pubgmhd.obbdownloaderser", appName = "无备注"),
        AppInfo(packageName = "com.tencent.heimao", appName = "无备注"),
        AppInfo(packageName = "com.b.y", appName = "无备注"),
        AppInfo(packageName = "com.flj.msnm", appName = "无备注"),
        AppInfo(packageName = "login.qq.pvp.xxif.cn", appName = "无备注"),
        AppInfo(packageName = "com.t3data.demo", appName = "无备注"),
        AppInfo(packageName = "pojie1.cdd520.biq", appName = "无备注"),
        AppInfo(packageName = "com.tencent.longxia", appName = "无备注"),
        AppInfo(packageName = "com.tencent.piggod", appName = "无备注"),
        AppInfo(packageName = "com.android.hl", appName = "无备注"),
        AppInfo(packageName = "com.tencent.qspeed.hita", appName = "无备注"),
        AppInfo(packageName = "com.agz", appName = "无备注"),
        AppInfo(packageName = "com.tencent.kb", appName = "无备注"),
        AppInfo(packageName = "com.cat.nongyao", appName = "无备注"),
        AppInfo(packageName = "com.tencent.att", appName = "无备注"),
        AppInfo(packageName = "com.coolapk.pepsi", appName = "无备注"),
        AppInfo(packageName = "com.yymb1", appName = "无备注"),
        AppInfo(packageName = "com.nbcom.adb", appName = "无备注"),
        AppInfo(packageName = "com.tencent.mmm", appName = "无备注"),
        AppInfo(packageName = "com.daniu.android", appName = "无备注"),
        AppInfo(packageName = "com.tencent.mobileqqkr", appName = "无备注"),
        AppInfo(packageName = "com.tencent.jyhz", appName = "无备注"),
        AppInfo(packageName = "com.tencent.mixue", appName = "无备注"),
        AppInfo(packageName = "com.tencent.battlefield", appName = "无备注"),
        AppInfo(packageName = "com.tencent.tmgp.jix", appName = "无备注"),
        AppInfo(packageName = "com.shenlong.pubg", appName = "无备注"),
        AppInfo(packageName = "com.h.z", appName = "无备注"),
        AppInfo(packageName = "com.tecent.qmht", appName = "无备注"),
        AppInfo(packageName = "com.yznb", appName = "无备注"),
        AppInfo(packageName = "com.tencent.nows", appName = "无备注"),
        AppInfo(packageName = "app.greyshirts.firewall", appName = "无备注"),
        AppInfo(packageName = "hynb.vip", appName = "无备注"),
        AppInfo(packageName = "com.assistant.k", appName = "无备注"),
        AppInfo(packageName = "com.tencnmt.crown", appName = "无备注"),
        AppInfo(packageName = "com.tencent.wx", appName = "无备注"),
        AppInfo(packageName = "com.tencent.wm", appName = "无备注"),
        AppInfo(packageName = "science.strive.com", appName = "无备注"),
        AppInfo(packageName = "com.miui.ljr", appName = "无备注"),
        AppInfo(packageName = "com.mixbc", appName = "无备注"),
        AppInfo(packageName = "com.dreamm.hpgjf1", appName = "无备注"),
        AppInfo(packageName = "com.ym", appName = "无备注"),
        AppInfo(packageName = "com.tencent.bigwasp", appName = "无备注"),
        AppInfo(packageName = "com.tencent.tmgp.zhz", appName = "无备注"),
        AppInfo(packageName = "com.miui.ppl", appName = "无备注"),
        AppInfo(packageName = "com.android.baidua", appName = "无备注"),
        AppInfo(packageName = "com.tencent.mobileqqjk", appName = "无备注"),
        AppInfo(packageName = "com.tencent.max", appName = "无备注"),
        AppInfo(packageName = "com.coolapk.pesei", appName = "无备注"),
        AppInfo(packageName = "com.tencent.mobileqqjj", appName = "无备注"),
        AppInfo(packageName = "bin.mt.plus.translationdata", appName = "无备注"),
        AppInfo(packageName = "eu.faircode.xlua", appName = "无备注"),
        AppInfo(packageName = "andlua", appName = "无备注"),
        AppInfo(packageName = "com.vmos", appName = "无备注"),
        AppInfo(packageName = "com.qqgame.happyj,f6a0bb", appName = "无备注"),
        AppInfo(packageName = "com.qqgame.happymj,f6a0bb7245074b9f080d03796f8919db", appName = "无备注"),
        AppInfo(packageName = "com.kkeji.news.client,a58fb2a01601adb8974379cc706a4eef", appName = "无备注"),
        AppInfo(packageName = "com.tencent.gamehelper.smoba,f8cdcfe8b8e226916e466b454cc72d24", appName = "无备注"),
        AppInfo(packageName = "com.tencent.karaoke,c7df05ab9bf28e06613ae61a5115985d", appName = "无备注"),
        AppInfo(packageName = "com.tencent.gps.cloudgame.opera,6684fabd147392382c9eb932caf9ef11", appName = "无备注"),
        AppInfo(packageName = "com.qqgame.hlddz,5c101bee9d0f4cc50ae05f3736a44c84", appName = "无备注"),
        AppInfo(packageName = "com.tencent.kihan,68ce8a967463a2c34b38adc48d0d373d", appName = "无备注"),
        AppInfo(packageName = "com.bubbles.drago", appName = "无备注"),
        AppInfo(packageName = "com.tencent.jdjf", appName = "无备注"),
        AppInfo(packageName = "com.laofanlogin", appName = "无备注"),
        AppInfo(packageName = "sharkfall.inc.shark", appName = "无备注"),
        AppInfo(packageName = "com.gokeep.keep", appName = "无备注"),
        AppInfo(packageName = "com.tencnmt.trumpcard", appName = "无备注"),
        AppInfo(packageName = "就开143234,45445", appName = "无备注"),
        AppInfo(packageName = "就开143234", appName = "无备注"),
        AppInfo(packageName = "5646546546", appName = "无备注"),
        AppInfo(packageName = "SharkFall.Inc.Shark1", appName = "111"),
        AppInfo(packageName = "com.manyou.ipchaxun,b4ac7d42c6471ba9f8cc282da9aa5a80", appName = "iP查询"),
        AppInfo(packageName = "com.github.uiautomator,518a7eab009c64f3fff1f3b20445f3ea", appName = "ATX"),
        AppInfo(packageName = "com.mula.mall,46e9e5f1dfbd091497579ef0387e5e70", appName = "密马"),
        AppInfo(packageName = "com.kuaishou.nebula,0f938c4f0995a83c9bf31f0c64322589", appName = "快手极速版"),
        AppInfo(packageName = "com.igwgame.playspace,cb6c6a912ea50aea12af677c619a8e31", appName = "畅玩空间"),
        AppInfo(packageName = "com.gvsoft.gofun,d9b65c5d968e71e2436428686a3d0594", appName = "GoFun出行"),
        AppInfo(packageName = "com.fvcorp.android.aijiasuclient,2f070437b9a203e878ba73eba79571f8", appName = "爱加速"),
        AppInfo(packageName = "com.xunmeng.pinduoduo,6e26e5a980e0ba33fe2e4ef23607dc54", appName = "拼多多"),
        AppInfo(packageName = "jp.co.cyberagent.stf,1f2ff4bf5de78d82027cf02e91842ce7", appName = "CloudphoneService"),
        AppInfo(packageName = "com.android.contacts,5dc8201f7db1ba4b9c8fc44146c5bcc2", appName = "通讯录"),
        AppInfo(packageName = "com.android.packageinstaller,8ddb342f2da5408402d7568af21e29f9", appName = "软件包安装程序"),
        AppInfo(packageName = "com.android.messaging,8ddb342f2da5408402d7568af21e29f9", appName = "短信"),
        AppInfo(packageName = "com.android.email,b605d904f897975f1da839ac749c4001", appName = "电子邮件"),
        AppInfo(packageName = "com.paopaodxcy,34b68d2b3043b3612d99edf1b6a22d0c", appName = "泡泡短信测压"),
        AppInfo(packageName = "com.android.managedprovisioning,8ddb342f2da5408402d7568af21e29f9", appName = "工作资料设置"),
        AppInfo(packageName = "com.miui.translation.kingsoft,701478a1e3b4b7e3978ea69469410f13", appName = "com.miui.translation.kingsoft"),
        AppInfo(packageName = "com.tencent.tmgp.pubgmhd,38b26479e4b500e8161598315c4ad35c", appName = "和平精英"),
        AppInfo(packageName = "com.smallyin.autoclick,3f461d585d5544001d45e9b53103817c", appName = "连续点击器"),
        AppInfo(packageName = "com.shanzhi.clicker,7aaf52f13b09d6f6ec8c6d27323b3998", appName = "闪指连点器"),
        AppInfo(packageName = "com.lmiot.xyclick,231985e37cf25fd00266f409d089f87e", appName = "连点器"),
        AppInfo(packageName = "com.shumai.shudaxia,1e34249f2726a3fff5d10475c5778398", appName = "鼠大侠自动点击连点器"),
        AppInfo(packageName = "simplehat.clicker,620a5d082bd50d5ffe3015e63f3f22c2", appName = "自动点击器"),
        AppInfo(packageName = "com.zidongdianji,2e483be64c29171caa51167a09ecaf61", appName = "自动点击器"),
        AppInfo(packageName = "com.jisuv.pro,e89b158e4bcf988ebd09eb83f5378e87", appName = "疾速pro"),
        AppInfo(packageName = "com.tencent.tim,68170b6b26e52338bc07ae665303cc36", appName = "鸭鸭一键上号器"),
        AppInfo(packageName = "com.tsng.hidemyapplist,2faaeea0bd2a6399cbcc40e98147772b", appName = "隐藏应用列表"),
        AppInfo(packageName = "com.shq,e89b158e4bcf988ebd09eb83f5378e87", appName = "QQ上号器"),
        AppInfo(packageName = "com.zxl.wechatqr,e3739aaf77b1069081b951d298ae17dd", appName = "上号神器"),
        AppInfo(packageName = "com.tencent.gamestick,00b1208638de0fcd3e920886d658daf6", appName = "腾讯游戏管家"),
        AppInfo(packageName = "com.tgp.autologin", appName = "无备注"),
        AppInfo(packageName = "yeke.ceshi.haha*", appName = "无备注"),
        AppInfo(packageName = "gjzs.online", appName = "外挂"),
        AppInfo(packageName = "fun.kitsunebi.kitsunebi4android", appName = "外挂"),
        AppInfo(packageName = "com.projectkr.shell", appName = "无备注"),
        AppInfo(packageName = "com.browser2345", appName = "无备注"),
        AppInfo(packageName = "mc.xianwu.beater", appName = "无备注"),
        AppInfo(packageName = "com.qihoo.cloudisk", appName = "无备注"),
        AppInfo(packageName = "com.bfire.da.nui", appName = "无备注"),
        AppInfo(packageName = "com.lanzou.gwa", appName = "无备注"),
        AppInfo(packageName = "a.b.c", appName = "测试外挂"),
        AppInfo(packageName = "方框", appName = "无备注"),
        AppInfo(packageName = "io.xmbz.virtualapp", appName = "无备注"),
        AppInfo(packageName = "com.bksegse.cmblse12", appName = "无备注"),
        AppInfo(packageName = "com.tencent.gamecommunity", appName = "无备注"),
        AppInfo(packageName = "f25625544e4b85e9bc62057299f26535", appName = "51虚拟机"),
        AppInfo(packageName = "e89b158e4bcf988ebd09eb83f5378e87", appName = "外挂"),
        AppInfo(packageName = "com.daofeng.gamematch", appName = "无备注"),
        AppInfo(packageName = "小芒", appName = "无备注"),
        AppInfo(packageName = "12e15f8605ab9be47805d4322aeb344e", appName = "测试"),
        AppInfo(packageName = "com.ludashi.dualspace", appName = "无备注"),
        AppInfo(packageName = "com.x8zs.sandbox", appName = "无备注"),
        AppInfo(packageName = "com.sollyu.xposed.hook.model", appName = "无备注"),
        AppInfo(packageName = "com.xuan.game", appName = "无备注"),
        AppInfo(packageName = "com.redfinger.business", appName = "无备注"),
        AppInfo(packageName = "com.f1player", appName = "无备注")
    )

    /**
     * 检测正在运行的程序
     */
    fun checkRunningApps(context: Context, currentBundle: String, gameBundle: String, callback: BackGroundCheckCallback) {
        if (isUsageAccessPermissionGranted(context)) {
            val usageStatsManager = context.getSystemService(Context.USAGE_STATS_SERVICE) as UsageStatsManager

            val endTime = System.currentTimeMillis()
            val startTime = endTime - 24 * 60 * 60 * 1000 // 从当前时间的前一天开始获取

            val usageStatsList = usageStatsManager.queryUsageStats(
                UsageStatsManager.INTERVAL_DAILY, startTime, endTime
            )

            for (usageStats in usageStatsList) {
                val packageName = usageStats.packageName
                println("Running App: $packageName")

                // 检测是否只有我们自己的应用和游戏在运行
                if (packageName != currentBundle && packageName != gameBundle) {
                    println("Detected unauthorized app: $packageName")
                    callback.onAppBackGroundDetected(true)
                    return
                }
                callback.onAppBackGroundDetected(false)
            }
        } else {
            // 如果没有获取到使用情况访问权限，可以跳转到设置页面请求权限
            openUsageAccessSettings(context)
        }
    }

    private fun isUsageAccessPermissionGranted(context: Context): Boolean {
        val appOpsManager = context.getSystemService(Context.APP_OPS_SERVICE) as AppOpsManager
        val mode = appOpsManager.checkOpNoThrow(OPSTR_GET_USAGE_STATS, android.os.Process.myUid(), context.packageName)
        return mode == AppOpsManager.MODE_ALLOWED
    }

    private fun openUsageAccessSettings(context: Context) {
        context.startActivity(Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS))
    }

}